using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data;
using DTO;
namespace DAO
{
  public   class SachDAO
    {
      public static DataTable laydanhsachsach_DAO()
      {
          DataTable dt = new DataTable();
          string sql = "select * from Sach";
          dt = DataProvider.ExcuteQuery(sql);
          return dt;
      }

      public static DataTable LayTatCaSach_DAO()
      {
          DataTable dt = new DataTable();
          string sql=" SELECT Sach.MaSach, Sach.TenSach , LoaiSach.TenLoaiSach,";
          sql += " Sach.TacGia, Sach.NamXuatBan, Sach.NhaXuatBan, Sach.NgayNhap,";
          sql += " Sach.Gia, NhanVien.HoTen,     Sach.TinhTrang ";
          sql += " FROM ((Sach INNER JOIN ";
          sql += " NhanVien ON Sach.NguoiTiepNhan = NhanVien.MaNhanVien) INNER JOIN ";
          sql += "  LoaiSach ON Sach.TheLoai = LoaiSach.MaTheLoaiSach) ";
          dt = DataProvider.ExcuteQuery(sql);
          return dt;

      }
    }
}
